// pages/discount/discount.js
Page({

  /**
   * 页面的初始数据
   */
  data: {
id:0,
zt:false
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
	wx.getStorage({
		key:'uid',
		success: (e) => {
			console.log(e)
			this.setData({
				uid:e.data.uid
			})
			this.resn()
		},
	})
  },

 list(e) {
 	console.log(e)
 	this.setData({
 		data:[],
 		id: e.detail.current
 	})
 	this.resn()
 },
 resn(){
	 wx.request({
		 url:getApp().globalData.http+'action=myQuanList&uid='+this.data.uid+'&sta='+this.data.id,
		 success: (e) => {
			 console.log(e)
		 	this.setData({
				data:e.data.data
			})
		 }
	 })
 },
 index(e){
 	this.setData({
 		id:e.currentTarget.dataset.id
 	})
 },
 draw(e){
	 if(this.data.id==0){
		 console.log()
		 if(e.currentTarget.dataset.id==""){
			 wx.switchTab({
			 		 url:'../index/index'
			 })
		 }else{
			 console.log(e.currentTarget.dataset.id)
			 let a=e.currentTarget.dataset.id
			 a=a.split('=')
			 wx.navigateTo({
			 		 url:'../index/mxzc/mxzc?id='+a[1]
			 })
		 }
	 }
 }
})